package com.cslg.ac.demo.dao.user.team;

import com.cslg.ac.demo.dao.user.po.team.TeamProfilePO;
import org.apache.ibatis.annotations.*;

@Mapper
public interface TeamProfileDAO {

    String TABLE_NAME = "e_t_account_profile";
    String SELECT_FIELD = "id,introduction,purpose,work,finance,t_condition tCondition,job_rules jobRules,adopt_rules adoptRules";

    @Insert({"insert into ",TABLE_NAME,"(id) values(#{id})"})
    void insert(@Param("id")int id);

    @Update({"update ",TABLE_NAME,"set introduction = #{introduction},purpose = #{purpose},work = #{work}," +
            "finance = #{finance},t_condition = #{tCondition} where id = #{id}"})
    void updateBasicById(TeamProfilePO teamProfilePO);

    @Update({"update ",TABLE_NAME,"set job_rules = #{jobRules} where id = #{id}"})
    void updateJobRule(@Param("id")int id,@Param("jobRules") String jobRules);

    @Update({"update ",TABLE_NAME,"set adopt_rules = #{adoptRules} where id = #{id}"})
    void updateAdoptRule(@Param("id")int id,@Param("adoptRules") String adoptRules);

    @Select({"select ",SELECT_FIELD,"from ",TABLE_NAME,"where id = #{id}"})
    TeamProfilePO selectById(@Param("id") int id);
}
